/*
 * JGO2RDF creates a RDF representation of GAF2 files, which are automatically sourced from GO ftp site.
 * Copyright (C) 2012 Matthew M. Hindle & Artem Lysenko
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package uk.co.jgo2rdf.goa.go;

/**
 * @author hindlem
 *         Date: 5/4/11
 *         Time: 2:58 PM
 * @version 0.10
 */
public class GOFactory {

    private static final String OLD_GO_PREFIX = "http://biordf.net/moby/GO/";
    private static final String GO_PREFIX = "http://godatabase.org/cgi-bin/go.cgi?query=GO:";

    /**
     * @param goId a go term with or without \"GO\":
     * @return the GO URI
     */
    public static String getGoUri(String goId) {
        goId = goId.toUpperCase();
        if (goId.startsWith("GO:"))
            goId = goId.substring(3);
        return String.format("%s%s", GO_PREFIX, goId);
    }

    /**
     * @param goId a go term with or without \"GO\":
     * @return the old uri form
     */
    public static String getOldGoUri(String goId) {
        goId = goId.toUpperCase();
        if (goId.startsWith("GO:"))
            goId = goId.substring(3);
        return String.format("%s%s", OLD_GO_PREFIX, goId);
    }


}
